<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/admin.css" media="all">
</head>
<body>

	<div class="layui-fluid">
	<div class="layui-card">



	<div class="layui-card-body">
	<table class="layui-table">
	  <colgroup>
		<col width="150">
		<col width="150">
		<col width="200">
		<col>
	  </colgroup>
	  <thead>
		<tr>
			<th>修改时间</th>
			<th>修改者</th>
			<th>操作</th>
		</tr> 
	  </thead>
	  <tbody>
	  {foreach $data as $key=>$v}
		<tr>
			<td style="text-align: center;">{$v.addtime|date="Y-m-d H:i:s"}</td>
			<td style="text-align: center;">{$v.username}</td>
			<td class="center">
				<a class="layui-btn layui-btn-sm" href="{:url('differ',array('page_id'=>$v['page_id'],'history_id'=>$v['id']))}" target="_blank">比差异</a>
				<button class="layui-btn layui-btn-sm" onclick="go_history(this)" data-content="{$v.content}">还原此版本</button>
			</td>
		</tr>
	   {/foreach}
	  </tbody>
	</table> 


      
	</div>
</div>

  <script src="/static/admin/layui/layui.js"></script>
  <script src="/static/js/jquery.min.js"></script>    
  <script src="/static/js/globals.js"></script>  
  <script>
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form'], function(){
    var $ = layui.$
    ,admin = layui.admin
    ,element = layui.element
    ,form = layui.form;


  });
    function go_history(obj){
        if(confirm("您确定要还原吗？")==false){
            return;
        }
        var content=$(obj).data("content");
        parent.parentUpdateCode=content;
        parent.updateCode();
        parent.layer.closeAll();
    }  
  </script>

</body>
</html>
